<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="layui/css/layui.css" media="all">
    <script type="text/javascript" src="libs/jquery.min.js"></script>
    <script type="text/javascript" src="layui/layui.js"></script>

    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
    <legend>手风琴折叠</legend>
</fieldset>
<div class="layui-collapse" lay-accordion="">
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">星期一</h2>
        <div class="layui-colla-content layui-show" id="Monday">

        </div>
    </div>
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">星期二</h2>
        <div class="layui-colla-content" id="Tuesday">

        </div>
    </div>
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">星期三</h2>
        <div class="layui-colla-content" id="Wednesday">

        </div>
    </div>
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">星期四</h2>
        <div class="layui-colla-content" id="Thursday">

        </div>
    </div>
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">星期五</h2>
        <div class="layui-colla-content" id="Friday">

        </div>
    </div>
</div>
<body>
<div id="test7" class="demo-tree"></div>
<script>
    layui.use(['element', 'layer'], function(){
        var element = layui.element;
        var layer = layui.layer;

        //监听折叠
        element.on('collapse(test)', function(data){
            layer.msg('展开状态：'+ data.show);
        });
    });
    $(function () {
        $.ajax({
            url:"trainer/getTrainerTimeInfo",
            type:"post",
            data:{
                tId:1
            },
            success:function(data){
                var Monday = data.Monday;
                var Tuesday = data.Tuesday;
                var Wednesday = data.Wednesday;
                var Thursday = data.Thursday;
                var Friday = data.Friday;
                $("#Monday").html(Monday);
                $("#Tuesday").html(Tuesday);
                $("#Wednesday").html(Wednesday);
                $("#Thursday").html(Thursday);
                $("#Friday").html(Friday);
            }
        });
    });
</script>
</body>

</html>